/**
 * @Filename: log.h
 * @Description:
 * @Author: chengxiaojun
 * @Email: xiaojun.chengxj@alibaba-inc.com
 * @Time: 2011/11/11
 */
#ifndef __LOG_H__
#define  __LOG_H__

//#define DEBUG
#ifdef DEBUG
#define TERR_DEBUG(format,...) fprintf(stderr,"\033[40;35mDEBUG:\033[0m "format"\n",##__VA_ARGS__ );
#else
#define TERR_DEBUG(format,...) 
#endif

#define STAT_LOG(format,...) fprintf(stderr,"\033[40;32mSTAT:\033[0m "format"\n",##__VA_ARGS__ );
#define INFO_LOG(format,...) fprintf(stderr,"\033[40;33mINFO:\033[0m "format"\n",##__VA_ARGS__ );
#define WARN_LOG(format,...) fprintf(stderr,"\033[40;34mWARN:\033[0m "format"\n",##__VA_ARGS__ );
#define ERROR_LOG(format,...) fprintf(stderr,"\033[40;31mERROR:\033[0m "format"\n",##__VA_ARGS__ );

#define STAT_GLOG(format,...) fprintf(stderr,"\033[40;32mGLOBAL STAT:\033[0m "format"\n",##__VA_ARGS__);
#define INFO_GLOG(format,...) fprintf(stderr,"\033[40;33mGLOBAL INFO:\033[0m "format"\n",##__VA_ARGS__);
#define WARN_GLOG(format,...) fprintf(stderr,"\033[40;34mGLOBAL WARN:\033[0m "format"\n",##__VA_ARGS__);
#define ERROR_GLOG(format,...) fprintf(stderr,"\033[40;31mGLOBAL ERROR:\033[0m "format"\n",##__VA_ARGS__);

#define FAIL "\033[40;31mFail\033[0m"
#define PASS "\033[40;32mPASS\033[0m"
#endif
